package com.xc.controller.protol;

import com.xc.common.ServerResponse;
import com.xc.pojo.UserBank;
import com.xc.service.IUserBankService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;

/**
 *  用户银行卡
 * @author mipha
 * @version 1.0
 * @date 2019/2/22 12:15 PM
 */
@Controller
@RequestMapping("/user/bank/")
@Slf4j
public class UserBankController {

    @Autowired
    IUserBankService iUserBankService;


    /**
     *  添加银行卡
     * @param bank
     * @param request
     * @return
     */
    @RequestMapping("add.do")
    @ResponseBody
    public ServerResponse add(UserBank bank , HttpServletRequest request){
        return iUserBankService.addBank(bank , request);
    }

    /**
     *  修改银行卡
     * @param bank
     * @param request
     * @return
     */
    @RequestMapping("update.do")
    @ResponseBody
    public ServerResponse update(UserBank bank , HttpServletRequest request){
        return iUserBankService.updateBank(bank , request);
    }

    /**
     *  获取银行卡信息
     * @param request
     * @return
     */
    @RequestMapping("getBankInfo.do")
    @ResponseBody
    public ServerResponse getBankInfo(HttpServletRequest request){
        return iUserBankService.getBankInfo(request);
    }





}
